﻿using System.Collections.Generic;
using System.Data;

namespace LL.Data
{
    public interface ISqlHelper
    {
        /// <summary>
        /// 执行非查询命令
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        int ExcuteNonQuery(string sql, params object[] parameters);
        
        /// <summary>
        /// 执行查询
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        DataTable ExcuteQuery(string sql, params object[] parameters);
        
        /// <summary>
        /// 执行标量查询
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="sql"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        T ExcuteScalar<T>(string sql, params object[] parameters);
        
        /// <summary>
        /// 执行存储过程
        /// </summary>
        /// <param name="procdureName"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        DataTable StoredProcdure(string procdureName, params object[] parameters);

        /// <summary>
        /// 查询
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="sql"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        IList<T> SqlQuery<T>(string sql, params object[] parameters);

    }
}
